<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
</head>
<body>
<script type="text/javascript">
$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'line',
                marginRight: 130,
                marginBottom: 25
            },
            title: {
                text: 'Estadisticas de <?php echo Yii::app()->user->store_name; ?>',
                x: -20 //center
            },
            subtitle: {
                text: 'Fuente: Google Analytics',
                x: -20
            },
            xAxis: {
                categories: [
                	<?php foreach ($account as $item): ?>
                		'<?php echo Yii::app()->dateFormatter->format('yyyy-MM-dd',$item['date']) ?>',
                	<?php endforeach ?>
                ]
            },
            yAxis: {
                title: {
                    text: 'Nro de Visitantes'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#808080'
                }]
            },
            tooltip: {
                formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                        this.x +': '+ this.y +' vistantes';
                }
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'top',
                x: -10,
                y: 100,
                borderWidth: 0
            },
            series: [{
                name: 'Visitas',
                data: [
                	<?php foreach ($account as $item): ?>
                		<?php echo $item['visits_number'] ?>,
                	<?php endforeach ?>
                ]
            }
            ]
        });
    });
    
});
	</script>
	<div id="container" style="min-width: 700px; height: 500px; margin: 0 auto"></div>
</body>
</html>